package com.example.oversea_home_spring.serviceImpl;

import com.example.oversea_home_spring.bean.Management;
import com.example.oversea_home_spring.bean.Order;
import com.example.oversea_home_spring.mapper.WorkerMapper;
import com.example.oversea_home_spring.service.WorkerService;
import com.example.oversea_home_spring.uitl.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WorkerServiceImpl implements WorkerService {

    @Autowired
    WorkerMapper workerMapper;

    // 待处理的订单 工人id
    @Override
    public List<Order> selectAllOrder(String workerId) {
        return workerMapper.selectAllOrder(workerId);
    }


    //我处理的订单  工人id
    @Override
    public List<Order> selectMyOrder(String workerId){
        return workerMapper.selectMyOrder(workerId);
    }

    //订单处理
    @Override
    public int updateOrder(Order order){
        return workerMapper.updateOrder(order);
    }

    //加入仓库工作
    @Override
    public int addManagement(Management management){
        return workerMapper.addManagement(management);
    }

    //辞职
    @Override
    public int updateManagementStatus(String managementId){
        return workerMapper.updateManagementStatus(managementId);
    }

}
